package com.cg.controller.announcement;

import java.util.List;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.cg.entity.AppQuestion;
import com.cg.service.impl.AppQuestionService;
import com.cg.utils.Query;
import com.cg.utils.R;
import com.cg.utils.annotation.SysLog;


/**
 * 反馈信息
 * @author cumt
 *
 */
@RestController
@RequestMapping("/sys/question")
public class AppQuestionController {
		
	@Autowired
	AppQuestionService appQuestionService;
	/**
	 * 所有列表
	 */
	@RequestMapping("/list")
	@RequiresPermissions("sys:question:list")
	public R list(@RequestParam Map<String, Object> params) {


//		// 查询列表数据
		Query query = new Query(params);
		List<AppQuestion> questionList = appQuestionService.queryList(query);
		int total = appQuestionService.queryTotal(query);

		return R.success(total, "", questionList);
	}
	
	/**
	 * 删除公告
	 */
	@SysLog("删除")
	@RequestMapping("/delete")
	@RequiresPermissions("sys:question:delete")
	public R delete(@RequestBody Long[] ids){
		
		appQuestionService.deleteBatch(ids);
		
		return R.ok();
	}
	
	
	
}	
